<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //数组克隆
        var arr=[1,2,3];
        var b=[];
        for(let i=0;i<arr.length;i++){
            b.push(arr[i]);
        }
        console.log(arr);
        console.log(b);
        //concat克隆
        var c=[4,5,6];
        // var d=arr.concat([7,8]);
        // var d=arr.concat();
        var d=[].concat(c);
        console.log(d);
    </script>
</body>
</html>